//------------------------------------------------------------------------------
// <copyright file="TypeExtension.cs" company="Damian Antonowicz">
//       copyright © 2010 Damian Antonowicz
// </copyright>
// <author>Damian Antonowicz</author>
// <email>poczta@damianantonowicz.pl</email>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAnton.Utilities.Extensions
{
    public static class TypeExtension
    {
        public static bool IsGenericIEnumerable(this Type t)
        {
            return t.IsGenericType &&
                   (typeof(IEnumerable<>).MakeGenericType(t.GetGenericArguments())).IsAssignableFrom(t);
        }
    }
}
